#include "bdd.h"

td_row *
make_row_td_row (row * r)
{
  td_row *n = (td_row *) malloc (sizeof (td_row));
  n->ident = (char *) malloc (strlen (r->ident) + 1);
  n->val = (char *) malloc (strlen (r->val) + 1);
  n->issub = 0;
  strcpy (n->ident, r->ident);
  strcpy (n->val, r->val);
  return (n);
}

td_row *
make_subbase_td_row (subbase * r)
{
  td_row *n = malloc (sizeof (td_row));
  n->ident = malloc (strlen (r->ident) + 1);
  strcpy (n->ident, r->ident);
  n->val = malloc (1);
  *(n->val) = 0;
  n->issub = 1;
  return (n);
}

void
make2 (void)
{
  if (root_head)
    pouf (root_head->base);
  else
    puts ("affichage impossible : aucune base");
  // write_bdd (root_head->base);
}

void
make_base (void)
{
puts (root_head->base->ident);
puts (root_head->base->enfant->ident);
del_subbase (root_head->base, root_head->base->enfant);
/*  root_head = add_base (root_head, "mamadoo");

  root_head->base->enfant = add_subbase (root_head->base, root_head->base->enfant, "auth");
  root_head->base->rows = add_row (root_head->base->rows, "leitmotiv","po po po");

  root_head->base->enfant->enfant = add_subbase (root_head->base->enfant, root_head->base->enfant->enfant, "#prog");
  root_head->base->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->rows, "topic", "codito ergo sum");
  root_head->base->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->rows, "modes", "+cnt");
  
  root_head->base->enfant->enfant->enfant = add_subbase (root_head->base->enfant->enfant, root_head->base->enfant->enfant->enfant, "Thaeron");
  root_head->base->enfant->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->enfant->rows, "pass", "youpie");
  root_head->base->enfant->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->enfant->rows, "mask", "Th*!*@");
  root_head->base->enfant->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->enfant->rows, "level", "400");

  root_head->base->enfant->enfant->enfant = add_subbase (root_head->base->enfant->enfant, root_head->base->enfant->enfant->enfant, "Symbiose");
  root_head->base->enfant->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->enfant->rows, "pass", "grouph");
  root_head->base->enfant->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->enfant->rows, "mask", "Symbiose!bot@*");
  root_head->base->enfant->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->enfant->rows, "level", "500");

  root_head->base->enfant->enfant = add_subbase (root_head->base->enfant, root_head->base->enfant->enfant, "#syndrome");
  root_head->base->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->rows, "topic", "zone de bots");
  root_head->base->enfant->enfant->rows = add_row (root_head->base->enfant->enfant->rows, "modes", "+nt");

  root_head->base->enfant->enfant->enfant = add_subbase (root_head->base->enfant->enfant, root_head->base->enfant->enfant->enfant, "Trompetiste");
  root_head->base->enfant->enfant->enfant = add_subbase (root_head->base->enfant->enfant, root_head->base->enfant->enfant->enfant, "Syndrome");
  root_head->base->enfant->enfant->enfant = add_subbase (root_head->base->enfant->enfant, root_head->base->enfant->enfant->enfant, "Symbiose");

   write_bdd (root_head->base);
  read_bdd ("mamadoo", O_AUTO);
  pouf (root_head->base);
*/
}
